package com.file.parser;

import com.file.bo.AppGjzwfwHyzjDetail;
import com.file.bo.AppGjzwfwHyzjIndex;
import com.file.bo.AppGjzwfwHyzjOriginal;
import com.file.bo.ResponseData;
import com.file.constant.ErrorCode;
import com.file.util.JsonUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.io.File;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

/**
 * 国家政务APP-婚姻证件xml解析
 *
 * @author anyspa
 */

@Slf4j
public class AppGjzwfwHyzjXmlParser extends BaseXmlParser {

    public ResponseData<String> parseAppGjzwfwHyzjXmlToJson(String daId, String filePath, String idNo) {
        log.info("parseAppGjzwfwHyzjXmlToJson started, daId:{}, filePath:{}, idNo:{}", daId, filePath, idNo);
        String json;
        AppGjzwfwHyzjOriginal appGjzwfwHyzjOriginal;
        try {
            if (filePath.contains("app-gjzwfw-hyzj-jhz-original") || filePath.contains("app-gjzwfw-hyzj-lhz-original")) {
                try {
                    appGjzwfwHyzjOriginal = parseAppGjzwfwHyzjOriginalXmlNew(filePath, idNo, daId);
                } catch (Exception e) {
                    appGjzwfwHyzjOriginal = parseAppGjzwfwHyzjOriginalXml(filePath, idNo);
                }
                json = JsonUtils.convertObjectToJson(appGjzwfwHyzjOriginal);
            } else if (filePath.contains("app-gjzwfw-hyzj-jhz-index") || filePath.contains("app-gjzwfw-hyzj-lhz-index")) {
                AppGjzwfwHyzjIndex appGjzwfwHyzjIndexXml = parseAppGjzwfwHyzjIndexXml(filePath);
                json = JsonUtils.convertObjectToJson(appGjzwfwHyzjIndexXml);
            } else if (filePath.contains("app-gjzwfw-hyzj-jhz") || filePath.contains("app-gjzwfw-hyzj-lhz")) {
                AppGjzwfwHyzjDetail appGjzwfwHyzjDetail = parseAppGjzwfwHyzjDetailXml(filePath);
                json = JsonUtils.convertObjectToJson(appGjzwfwHyzjDetail);
            } else {
                throw new RuntimeException("the file name is not supported");
            }
        } catch (Exception e) {
            log.error("OnError|{}||{}|{}|{}|{}", ErrorCode.FILE_PARSE_EXCEPTION.getCode(), daId, "", "", "parseAppGjzwfwHyzjXmlToJson failed", e);
            return new ResponseData<>(null, ErrorCode.FILE_PARSE_EXCEPTION.getCode(),
                    ErrorCode.FILE_PARSE_EXCEPTION.getMsg());
        }

        log.info("parseAppGjzwfwHyzjXmlToJson completed, daId:{}, filePath:{}, idNo:{}", daId, filePath, idNo);
        return new ResponseData<>(json, ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg());
    }

    private AppGjzwfwHyzjDetail parseAppGjzwfwHyzjDetailXml(String filePath) throws DocumentException {
        AppGjzwfwHyzjDetail appGjzwfwHyzjDetail = new AppGjzwfwHyzjDetail();
        List<String> nodeTextList = getNodeTextList(filePath);
        for (int i = 0; i < nodeTextList.size(); i++) {
            if (i < (nodeTextList.size() - 1)) {
                if (nodeTextList.get(i).contains("证件名称")) {
                    appGjzwfwHyzjDetail.setCertificateName(nodeTextList.get(i + 1));
                } else if (StringUtils.containsAny(nodeTextList.get(i), "证件编号", "证照号码")) {
                    appGjzwfwHyzjDetail.setCertificateNo(nodeTextList.get(i + 1));
                } else if (nodeTextList.get(i).contains("持有人名称")) {
                    appGjzwfwHyzjDetail.setOwnerName(nodeTextList.get(i + 1));
                } else if (nodeTextList.get(i).contains("持有人身份证")) {
                    appGjzwfwHyzjDetail.setOwnerIdNo(nodeTextList.get(i + 1));
                } else if (nodeTextList.get(i).contains("签发机构")) {
                    // 适配签发机构 key和value顺序相反的用例
                    if (nodeTextList.get(i + 1).contains("发证机构唯一") && nodeTextList.get(i - 3).contains("持有人身份证")) {
                        appGjzwfwHyzjDetail.setIssuingAuthority(nodeTextList.get(i - 1));
                    } else {
                        appGjzwfwHyzjDetail.setIssuingAuthority(nodeTextList.get(i + 1));
                    }
                } else if (nodeTextList.get(i).contains("发证机构唯一")) {
                    appGjzwfwHyzjDetail.setIssuingAuthorityUniqueIdentification(nodeTextList.get(i + 1));
                } else if (nodeTextList.get(i).contains("发证机构所属")) {
                    appGjzwfwHyzjDetail.setIssuingAuthorityAdministrativeRegionCode(nodeTextList.get(i + 1));
                } else if (nodeTextList.get(i).contains("发证日期")) {
                    appGjzwfwHyzjDetail.setIssuingDate(nodeTextList.get(i + 1));
                }
            }
        }

        return appGjzwfwHyzjDetail;
    }

    private AppGjzwfwHyzjIndex parseAppGjzwfwHyzjIndexXml(String filePath) throws DocumentException {
        AppGjzwfwHyzjIndex appGjzwfwHyzjIndex = new AppGjzwfwHyzjIndex();
        SAXReader reader = new SAXReader();
        Document document = reader.read(new File(filePath));

        Element certificateNameElement = (Element) document.selectSingleNode("//android.widget.TextView[@resource-id='com.service.android.gov.cn:id/tv_licence_name']");
        appGjzwfwHyzjIndex.setCertificateName(certificateNameElement.attributeValue("text"));

        Element nameElement = (Element) document.selectSingleNode("//android.widget.TextView[@resource-id='com.service.android.gov.cn:id/tv_owner']");
        appGjzwfwHyzjIndex.setName(nameElement.attributeValue("text"));

        Element certificateNumberElement = (Element) document.selectSingleNode("//android.widget.TextView[@resource-id='com.service.android.gov.cn:id/tv_licence_id']");
        appGjzwfwHyzjIndex.setCertificateNumber(certificateNumberElement.attributeValue("text"));

        Element certificateIssuingAgencyElement = (Element) document.selectSingleNode("//android.widget.TextView[@resource-id='com.service.android.gov.cn:id/tv_issuing_authority']");
        appGjzwfwHyzjIndex.setCertificateIssuingAgency(certificateIssuingAgencyElement.attributeValue("text"));

        Element certificateIssuingDateElement = (Element) document.selectSingleNode("//android.widget.TextView[@resource-id='com.service.android.gov.cn:id/tv_issuing_date']");
        appGjzwfwHyzjIndex.setCertificateIssuingDate(certificateIssuingDateElement.attributeValue("text"));

        return appGjzwfwHyzjIndex;
    }

    private AppGjzwfwHyzjOriginal parseAppGjzwfwHyzjOriginalXml(String filePath, String holderIdNo) throws DocumentException {
        // 中华人民共和国结婚证证照文件预览1234张三2019年03月25日J440305-2019-003597张三男中国1986年05月00日400000198605000031李四女中国1984年12月08日4000001984120816270034
        List<String> nodeTextList = getNodeTextList(filePath).stream()
                .filter(text -> !StringUtils.equalsAny(text.trim(), "男", "女"))
                .collect(Collectors.toList());

        // 中华人民共和国结婚证证照文件预览1234张三2019-03-25J440305-2019-003597张三中国1986-05-00400000198605000031李四中国1984-12-084000001984120816270034
        List<String> simplifyNodeTextList = new ArrayList<>();
        if (nodeTextList.contains("年") && nodeTextList.contains("月")) {
            for (int i = 0; i < nodeTextList.size(); i++) {
                String text = nodeTextList.get(i);
                if (nodeTextList.get(i).matches("\\d{4}")
                        && nodeTextList.get(i + 2).matches("\\d{1,2}")
                        && nodeTextList.get(i + 4).matches("\\d{1,2}")) {
                    String date = nodeTextList.get(i).concat("-").concat(nodeTextList.get(i + 2).length() == 1 ? "0" + nodeTextList.get(i + 2) : nodeTextList.get(i + 2)).concat("-").concat(nodeTextList.get(i + 4).length() == 1 ? "0" + nodeTextList.get(i + 4) : nodeTextList.get(i + 4));
                    simplifyNodeTextList.add(date);
                    i += 5; //NOSONAR
                } else if (nodeTextList.get(i).matches("\\d{4}")
                        && nodeTextList.get(i + 2).matches("\\d{1,2}")
                        && nodeTextList.get(i + 4).matches("\\d{1,2}日")) {
                    String date = nodeTextList.get(i).concat("-").concat(nodeTextList.get(i + 2).length() == 1 ? "0" + nodeTextList.get(i + 2) : nodeTextList.get(i + 2)).concat("-").concat(nodeTextList.get(i + 4).length() == 1 ? "0" + nodeTextList.get(i + 4) : nodeTextList.get(i + 4));
                    if (date.contains("日")) {
                        date = date.replace("日", "");
                    }
                    simplifyNodeTextList.add(date);
                    i += 4; //NOSONAR
                    // 处理带x身份证分两行情况 "330824197**1","X",
                } else if (nodeTextList.get(i).matches("\\d{17}") && nodeTextList.get(i + 1).matches("[xX]{1}")) {
                    simplifyNodeTextList.add(nodeTextList.get(i) + nodeTextList.get(i + 1));
                    i += 1;  //NOSONAR
                } else {
                    simplifyNodeTextList.add(text);
                }
            }
        } else {
            simplifyNodeTextList.addAll(nodeTextList);
        }

        AppGjzwfwHyzjOriginal appGjzwfwHyzjOriginal = new AppGjzwfwHyzjOriginal();
        appGjzwfwHyzjOriginal.setHolderIdNo(holderIdNo);

        List<String> idNoList = simplifyNodeTextList.stream()
                .filter(text -> text.trim().matches("(\\d{15}(\\d{2}[0-9xX])?)|[0-9a-zA-Z]{8,9}"))
                .distinct()
                .collect(Collectors.toList());
        if (idNoList.size() != 2) {
            throw new RuntimeException("there are no 2 idNo found!");

        }
        Optional<String> partnerIdNoOptional = idNoList.stream()
                .filter(idNo -> (!StringUtils.equals(idNo, holderIdNo)))
                .findFirst();
        if (!partnerIdNoOptional.isPresent()) {
            throw new RuntimeException("partner idNo is not found");
        }

        String partnerIdNo = partnerIdNoOptional.get();
        appGjzwfwHyzjOriginal.setPartnerIdNo(partnerIdNo);

        // 中华人民共和国结婚证证照文件预览|1|2|3|4|张三|2019-03-25|J440305-2019-003597|张三|中国|1986-05-00|400000198605000031|李四|中国|1984-12-08|4000001984120816270034
        String nodeTextString = String.join("|", simplifyNodeTextList);
        System.out.println("nodeTextString = " + nodeTextString);   //NOSONAR
        List<List<String>> list = new ArrayList<>();
        // 张三|中国|1986-05-00|400000198605000031
        // 张三|中国|400000198412081627
        // 张三|中国|1986-05-00
        Pattern pattern = Pattern.compile("((([\\u4E00-\\u9FA5]{2,}|([a-zA-Z]{3,}\\s*+)+)\\|[\\u4E00-\\u9FA5]{2,}\\|)" + //NOSONAR
                "(((\\d{4}-\\d{2}-\\d{2})(\\|((\\d{15}(\\d{2}[0-9xX])?)|[0-9a-zA-Z]{8,9}))?)" +
                "|((\\d{15}(\\d{2}[0-9xX])?)|[0-9a-zA-Z]{8,9})))");
        Matcher matcher = pattern.matcher(nodeTextString);
        while (matcher.find()) {
            String group = matcher.group();
            List<String> textList = Arrays.asList(group.split("\\|"));
            list.add(textList);
        }

        for (List<String> textList : list) {
            if (textList.contains(holderIdNo) || containBirthDay(holderIdNo, textList)) {
                // 张三|中国|1986-05-00|400000198605000031
                if (StringUtils.isBlank(appGjzwfwHyzjOriginal.getHolderName())) { //NOSONAR
                    appGjzwfwHyzjOriginal.setHolderName(textList.get(0));
                }
            } else if (textList.contains(partnerIdNo) || containBirthDay(partnerIdNo, textList)) {
                // 李四|中国|1984-12-08|4000001984120816270034
                if (StringUtils.isBlank(appGjzwfwHyzjOriginal.getPartnerName())) { //NOSONAR
                    appGjzwfwHyzjOriginal.setPartnerName(textList.get(0));
                }
            }
        }

        //遇到特殊用力，不匹配上面格式
        if (StringUtils.isAnyEmpty(appGjzwfwHyzjOriginal.getHolderIdNo(), appGjzwfwHyzjOriginal.getHolderName(),
                appGjzwfwHyzjOriginal.getPartnerIdNo(), appGjzwfwHyzjOriginal.getPartnerName())) {
            //|吴**|2020-04-08|J340122-2020-001584|官**|中国|吴**|中国|1986-12-29|35042719861229****|1990-04-07|34012319900407****|合肥市肥东县民政局婚姻登记处|杨**
            Pattern pattern2 = Pattern.compile("[\\u4E00-\\u9FA5]{2,}\\|中国\\|[\\u4E00-\\u9FA5]{2,}\\|中国");
            Matcher matcher2 = pattern2.matcher(nodeTextString);
            List<String> textList2 = new ArrayList<>();
            while (matcher2.find()) {
                String group = matcher2.group();
                textList2 = Arrays.asList(group.split("\\|"));
            }
            if (textList2.size() > 2) {
                if (nodeTextString.contains("点击查看电子签章验证信息|" + textList2.get(2))) {
                    appGjzwfwHyzjOriginal.setHolderName(textList2.get(2));
                    appGjzwfwHyzjOriginal.setPartnerName(textList2.get(0));
                } else {
                    appGjzwfwHyzjOriginal.setHolderName(textList2.get(0));
                    appGjzwfwHyzjOriginal.setPartnerName(textList2.get(2));
                }
            }
        }
        if (StringUtils.isAnyEmpty(appGjzwfwHyzjOriginal.getHolderIdNo(), appGjzwfwHyzjOriginal.getHolderName(),
                appGjzwfwHyzjOriginal.getPartnerIdNo(), appGjzwfwHyzjOriginal.getPartnerName())) {
            throw new RuntimeException("the 4 parse fields are not completely parsed");
        }
        return appGjzwfwHyzjOriginal;
    }


    private boolean containBirthDay(String idNo, List<String> textList) {
        return idNo.length() >= 15 &&
                textList.contains(idNo.substring(6, 10).concat("-").concat(idNo.substring(10, 12).concat("-").concat(idNo.substring(12, 14))));
    }


    private AppGjzwfwHyzjOriginal parseAppGjzwfwHyzjOriginalXmlNew(String filePath, String holderIdNo, String daId) throws DocumentException {

        List<TextNode> textNodeList = getTextNodeList(filePath);
        Set<TextNode> simplifyNodeTextSet = new HashSet<>();

        // 去除多余node,只保留姓名、身份证号
        for (int i = 0; i < textNodeList.size(); i++) {
            String text = textNodeList.get(i).getText();
            TextNode textNode = textNodeList.get(i);
            if (StringUtils.containsAny(text, "中国")) {
                continue;
            } else if (text.matches("^[1-9]\\d{5}(19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|X)$")) {
                simplifyNodeTextSet.add(textNodeList.get(i));
            } else if (text.matches("\\d{17}") && textNodeList.get(i + 1).getText().matches("[xX]{1}")) {
                textNode.setText(text + textNodeList.get(i + 1).getText());
                simplifyNodeTextSet.add(textNode);
                i += 1;
            } else if (text.matches("^[\u4e00-\u9fa5]{2,3}$")) {
                simplifyNodeTextSet.add(textNode);
            }
        }
        if (simplifyNodeTextSet.size() <= 4) {
            throw new RuntimeException("the 4 parse fields are not completely parsed");
        }


        List<TextNode> simplifyNodeTextList = new ArrayList<>(simplifyNodeTextSet);
        // 如果两个node y坐标差值很小，则认为两个node是在同一行进行对齐
        alignNodes(simplifyNodeTextList);
        // 对 simplifyNodeTextList根据point排序,排序后姓名和身份证顺序一定是和页面显示一致
        // name|name|idNo|idNo
        simplifyNodeTextList.sort(Comparator.comparingInt(TextNode::getY).thenComparingInt(TextNode::getX));

        AppGjzwfwHyzjOriginal appGjzwfwHyzjOriginal = new AppGjzwfwHyzjOriginal();
        String textNodeString = simplifyNodeTextList.stream().map(TextNode::getText)
                .reduce((a, b) -> a + "|" + b).orElse("");
        System.out.println("textNodeString = " + textNodeString);   //NOSONAR

        String nameRegex = "([\\u4e00-\\u9fa5]{2,3})";
        String idnoRegex = "([1-9]\\d{5}(19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|X))";
        List<TextNode> IdNoNodeList = simplifyNodeTextSet.stream().filter(x -> x.getText().matches(idnoRegex)).collect(Collectors.toList());
        if (IdNoNodeList.size() < 2) {
            throw new RuntimeException("there are no 2 idNo found!");
        }
        TextNode holderIdNoNode = IdNoNodeList.stream().filter(x -> StringUtils.equals(x.getText(), holderIdNo)).findFirst().orElse(null);
        if (holderIdNoNode == null) {
            throw new RuntimeException("the holderIdNo is not found!");
        }

        Pattern pattern = Pattern.compile(StringUtils.join(nameRegex, "\\|", nameRegex, "\\|", idnoRegex, "\\|", idnoRegex));
        Matcher matcher = pattern.matcher(textNodeString);
        if (matcher.find()) {
            String group = matcher.group();
            List<String> list = Arrays.asList(group.split("\\|"));
            // holdName|partnerName|holderIdNo|partnerIdNo
            if (StringUtils.equals(list.get(2), holderIdNo)) {
                appGjzwfwHyzjOriginal.setHolderName(list.get(0));
                appGjzwfwHyzjOriginal.setPartnerName(list.get(1));
                appGjzwfwHyzjOriginal.setHolderIdNo(list.get(2));
                appGjzwfwHyzjOriginal.setPartnerIdNo(list.get(3));
            } else {
                // partnerName|holdName|partnerIdNo|holderIdNo
                appGjzwfwHyzjOriginal.setHolderName(list.get(1));
                appGjzwfwHyzjOriginal.setPartnerName(list.get(0));
                appGjzwfwHyzjOriginal.setHolderIdNo(list.get(3));
                appGjzwfwHyzjOriginal.setPartnerIdNo(list.get(2));
            }
        } else {
            log.error("OnError|{}||{}|{}|{}|{}", ErrorCode.FILE_PARSE_EXCEPTION.getCode(), daId, simplifyNodeTextList, "parseAppGjzwfwHyzjXmlToJson failed", null);
        }
        if (StringUtils.isAnyEmpty(appGjzwfwHyzjOriginal.getHolderIdNo(), appGjzwfwHyzjOriginal.getHolderName(),
                appGjzwfwHyzjOriginal.getPartnerIdNo(), appGjzwfwHyzjOriginal.getPartnerName())) {
            throw new RuntimeException("the 4 parse fields are not completely parsed");
        }
        return appGjzwfwHyzjOriginal;
    }

    private void alignNodes(List<TextNode> nodes) {
        for (int i = 0; i < nodes.size(); i++) {
            TextNode currentNode = nodes.get(i);
            for (int j = i + 1; j < nodes.size(); j++) {
                TextNode nextNode = nodes.get(j);
                if (Math.abs(currentNode.getY() - nextNode.getY()) < 50) {
                    int newY = (currentNode.getY() + nextNode.getY()) / 2;
                    currentNode.setY(newY);
                    nextNode.setY(newY);
                }
            }
        }
    }

    private List<TextNode> getTextNodeList(String filePath) throws DocumentException {
        SAXReader reader = new SAXReader();
        Document document = reader.read(new File(filePath));
        return parseNode(document.getRootElement().elements());
    }

    private List<TextNode> parseNode(List<Element> elements) {
        List<TextNode> textNodeList = new ArrayList<>();
        elements.forEach(element -> {
            String text = element.attributeValue("text");
            if (StringUtils.isNotBlank(text)) {
                TextNode node = new TextNode();
                String bounds = element.attributeValue("bounds");
                String[] point = bounds.replace("[", "").split("]")[0].split(",");
                node.setText(text);
                node.setX(Integer.parseInt(point[0]));
                node.setY(Integer.parseInt(point[1]));
                textNodeList.add(node);
            }
            textNodeList.addAll(parseNode(element.elements()));
        });

        return textNodeList;
    }

    @Data
    @EqualsAndHashCode
    public static class TextNode {
        String text;
        int x;
        int y;
    }

    public static void main(String[] args) {
        AppGjzwfwHyzjXmlParser appGjzwfwHyzjXmlParser = new AppGjzwfwHyzjXmlParser();
        String json = "";
//
//        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\0904\\app-gjzwfw-hyzj-jhz-original-1.xml", "350182199106021717").getData();
//        System.out.println(json);
//        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\0912\\app-gjzwfw-hyzj-lhz-original-1.xml", "342623199511160910").getData();
//        System.out.println(json);
//
//        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\de1x1wwn1734488682425724928_7f7a37ba23ce72d343a7a3fc1658423f_app-gjzwfw-hyzj_origins\\app-gjzwfw-hyzj-jhz-original-1.xml", "430682198910177918").getData();
//        System.out.println(json);
//
//        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\zd4q0c2v1861641581881503744_8b467438a982eed3132b2b5e4cb5caa6_app-gjzwfw-hyzj_origins\\app-gjzwfw-hyzj-jhz-original-1.xml", "320681199103300222").getData();
//        System.out.println(json);
//        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\zd4q0c2v1861641581881503744_8b467438a982eed3132b2b5e4cb5caa6_app-gjzwfw-hyzj_origins\\app-gjzwfw-hyzj-lhz-original-1.xml", "320681199103300222").getData();
//        System.out.println(json);
//        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\zd4th7gy1861393949146755072_86450eeed949a1ac6579ae9e450c1e3a_app-gjzwfw-hyzj_origins\\app-gjzwfw-hyzj-jhz-original-1.xml", "360111199308160930").getData();
//        System.out.println(json);
//        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\zd4th7gy1861617434032877568_87088c3bb9317d28d3c05b10a3e45722_app-gjzwfw-hyzj_origins\\app-gjzwfw-hyzj-jhz-original-1.xml", "320322199210153014").getData();
//        System.out.println(json);
        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\1101\\app-gjzwfw-hyzj-jhz-1.xml", "320322199210153014").getData();
        System.out.println(json);
//        json = appGjzwfwHyzjXmlParser.parseAppGjzwfwHyzjXmlToJson("", "D:\\data\\file\\app-gjzwfw-hyzj\\zd4th7gy1861678828844621824_16e651c2bec5c353c867e72b39a28ddc_app-gjzwfw-hyzj_origins\\app-gjzwfw-hyzj-jhz-original-1.xml", "370832199409152528").getData();
//        System.out.println(json);

    }
}
